package com.fivefox.attendance.domain;

import com.alibaba.fastjson2.JSONObject;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.*;

/**
 * @author: 李任起
 * @description: 类描述
 * @createDate: 2023-06-30 9:38
 */
public class UserFlow {
    /**
     * 用户 ID
     * <p> 示例值：abd754f7
     */
    @JsonProperty("user_id")
    private String userId;
    /**
     * 记录创建者 ID
     * <p> 示例值：abd754f7
     */
    @JsonProperty("creator_id")
    private String creatorId;
    /**
     * 打卡位置名称信息
     * <p> 示例值：西溪八方城
     */
    @JsonProperty("location_name")
    private String locationName;
    /**
     * 打卡时间，精确到秒的时间戳
     * <p> 示例值：1611476284
     */
    @JsonProperty("check_time")
    private String checkTime;
    /**
     * 打卡备注
     * <p> 示例值：上班打卡
     */
    @JsonProperty("comment")
    private String comment;
    /**
     * 打卡记录 ID
     * <p> 示例值：6709359313699356941
     */
    @JsonProperty("record_id")
    private String recordId;
    /**
     * 打卡 Wi-Fi 的 SSID
     * <p> 示例值：b0:b8:67:5c:1d:72
     */
    @JsonProperty("ssid")
    private String ssid;
    /**
     * 打卡 Wi-Fi 的 MAC 地址
     * <p> 示例值：b0:b8:67:5c:1d:72
     */
    @JsonProperty("bssid")
    private String bssid;
    /**
     * 是否为外勤打卡
     * <p> 示例值：true
     */
    @JsonProperty("is_field")
    private Boolean isField;
    /**
     * 是否为 Wi-Fi 打卡
     * <p> 示例值：true
     */
    @JsonProperty("is_wifi")
    private Boolean isWifi;
    /**
     * 记录生成方式
     * <p> 示例值：在开放平台调用时，此参数无效，内部值始终是7
     */
    @JsonProperty("type")
    private Integer type;
    /**
     * 打卡照片列表
     * <p> 示例值：https://time.clockin.biz/manage/download/6840389754748502021
     */
    @JsonProperty("photo_urls")
    private String[] photoUrls;
    /**
     * 打卡结果
     * <p> 示例值：Invalid
     */
    @JsonProperty("check_result")
    private String checkResult;

    // builder 开始
    public UserFlow() {
    }

    public String getUserId() {
        return this.userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getCreatorId() {
        return this.creatorId;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    public String getLocationName() {
        return this.locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public String getCheckTime() {
        return this.checkTime;
    }

    public void setCheckTime(String checkTime) {
        this.checkTime = checkTime;
    }

    public String getComment() {
        return this.comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getRecordId() {
        return this.recordId;
    }

    public void setRecordId(String recordId) {
        this.recordId = recordId;
    }

    public String getSsid() {
        return this.ssid;
    }

    public void setSsid(String ssid) {
        this.ssid = ssid;
    }

    public String getBssid() {
        return this.bssid;
    }

    public void setBssid(String bssid) {
        this.bssid = bssid;
    }

    public Boolean getIsField() {
        return this.isField;
    }

    public void setIsField(Boolean isField) {
        this.isField = isField;
    }

    public Boolean getIsWifi() {
        return this.isWifi;
    }

    public void setIsWifi(Boolean isWifi) {
        this.isWifi = isWifi;
    }

    public Integer getType() {
        return this.type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String[] getPhotoUrls() {
        return this.photoUrls;
    }

    public void setPhotoUrls(String[] photoUrls) {
        this.photoUrls = photoUrls;
    }

    public String getCheckResult() {
        return this.checkResult;
    }

    public void setCheckResult(String checkResult) {
        this.checkResult = checkResult;
    }

    /**
     * 返回接口需要的json字符串
     */
    public static String getFlowRecords(List<UserFlow> userFlowList) {
        Map<String,List<UserFlow>> map=new HashMap<>();
        map.put("flow_records",userFlowList);
        String text=JSONObject.toJSONString(map);
        return text;
    }

    @Override
    public String toString() {
        return "flow_records{" +
                "userId='" + userId + '\'' +
                ", creatorId='" + creatorId + '\'' +
                ", locationName='" + locationName + '\'' +
                ", checkTime='" + checkTime + '\'' +
                ", comment='" + comment + '\'' +
                ", recordId='" + recordId + '\'' +
                ", ssid='" + ssid + '\'' +
                ", bssid='" + bssid + '\'' +
                ", isField=" + isField +
                ", isWifi=" + isWifi +
                ", type=" + type +
                ", photoUrls=" + Arrays.toString(photoUrls) +
                ", checkResult='" + checkResult + '\'' +
                '}';
    }
}
